package com.smz.service.impl;


import com.smz.dao.FunctionsDAO;
import com.smz.entity.Functions;
import com.smz.service.FunctionsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FunctionsServiceImpl implements FunctionsService {
    @Autowired
    private FunctionsDAO functionsDAO;


    @Override
    public List<Functions> selectFunctionsByName(String username) {
        return functionsDAO.selectFunctionsByName(username);
    }

    @Override
    public List<Functions> selectAllFunctions() {
        return functionsDAO.selectAllFunctions();
    }

    @Override
    public List<Functions> selectByRoleId(Integer id) {
        return functionsDAO.selectByRoleId(id);
    }

    @Override
    public List<Functions> findAll() {
        return functionsDAO.selectAll();
    }

    @Override
    public void addFunction(Functions functions) {
        functionsDAO.insertFunction(functions);
    }

    @Override
    public void modifyFunction(Functions functions) {
        functionsDAO.updateFunction(functions);
    }

    @Override
    public void removeFunction(Integer id) {
        functionsDAO.deleteFunction(id);
    }
}
